package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-05-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("monthly_user_device")
@NoArgsConstructor
public class MonthlyUserDevice implements Serializable {

    private static final long serialVersionUID = 1L;

    public MonthlyUserDevice(Integer userId, Integer deviceId, Boolean canUse) {
        this.userId = userId;
        this.deviceId = deviceId;
        this.canUse = canUse;
    }

    /**
     * 用户-可用机器关系映射表(业务员分配机器时添入数据,订单表->当前表)
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 机器id
     */
    @TableField("device_id")
    private Integer deviceId;

//    /**
//     * 机器是否为启动状态
//     */
//    @TableField("device_open")
//    private Boolean deviceOpen;
//
//    /**
//     * 工作的停止时间
//     */
//    @TableField("work_stop_time")
//    private Date workStopTime;

    /**
     * 管理未审核/用户未激活/月费已过期->不可用
     */
    @TableField("can_use")
    private Boolean canUse;

    /**
     * 是否开启了托管
     */
    @TableField("trusteeship")
    private Boolean trusteeship;

    /**
     * 过期时间
     */
    @TableField(exist = false)
    private Date expireTime;

    /**
     * 负责人姓名
     */
    @TableField(exist = false)
    private String adminName;

    /**
     * 负责人电话
     */
    @TableField(exist = false)
    private String adminPhone;

    /**
     * 机器的状态(开启,空闲,定时中)
     */
    @TableField(exist = false)
    private String status;

    /**
     * 截止运行时间(停止时间)
     */
    @TableField(exist = false)
    private String stopTime;

    /**
     * 机器码
     */
    @TableField(exist = false)
    private String deviceCode;

}
